package com.hyperboost.backend.service.impl;

import java.util.List;
import com.hyperboost.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hyperboost.backend.mapper.ShareTagMapper;
import com.hyperboost.backend.domain.ShareTag;
import com.hyperboost.backend.service.IShareTagService;

/**
 * 分享标签Service业务层处理
 * 
 * @author LXY
 * @date 2025-04-19
 */
@Service
public class ShareTagServiceImpl implements IShareTagService 
{
    @Autowired
    private ShareTagMapper shareTagMapper;

    /**
     * 查询分享标签
     * 
     * @param tagId 分享标签主键
     * @return 分享标签
     */
    @Override
    public ShareTag selectShareTagByTagId(Long tagId)
    {
        return shareTagMapper.selectShareTagByTagId(tagId);
    }

    /**
     * 查询分享标签列表
     * 
     * @param shareTag 分享标签
     * @return 分享标签
     */
    @Override
    public List<ShareTag> selectShareTagList(ShareTag shareTag)
    {
        return shareTagMapper.selectShareTagList(shareTag);
    }

    /**
     * 新增分享标签
     * 
     * @param shareTag 分享标签
     * @return 结果
     */
    @Override
    public int insertShareTag(ShareTag shareTag)
    {
        shareTag.setCreateTime(DateUtils.getNowDate());
        return shareTagMapper.insertShareTag(shareTag);
    }

    /**
     * 修改分享标签
     * 
     * @param shareTag 分享标签
     * @return 结果
     */
    @Override
    public int updateShareTag(ShareTag shareTag)
    {
        shareTag.setUpdateTime(DateUtils.getNowDate());
        return shareTagMapper.updateShareTag(shareTag);
    }

    /**
     * 批量删除分享标签
     * 
     * @param tagIds 需要删除的分享标签主键
     * @return 结果
     */
    @Override
    public int deleteShareTagByTagIds(Long[] tagIds)
    {
        return shareTagMapper.deleteShareTagByTagIds(tagIds);
    }

    /**
     * 删除分享标签信息
     * 
     * @param tagId 分享标签主键
     * @return 结果
     */
    @Override
    public int deleteShareTagByTagId(Long tagId)
    {
        return shareTagMapper.deleteShareTagByTagId(tagId);
    }
}
